let header = new Vue({
	el:"#header",
	data: {
		user:{},
		checkLogin: false,
		carts: [],
		count: 0,
		types: [],
		tno: "",
		keywords:""
	},
	watch: {
		carts: {
			handler: function(newObj, oldObj){
				this.num = this.carts.length;
			},
			deep: true
		}
	},
	mounted: function(){
		/*axios.get("menber/info").then(rt => {
			if(rt.status == 200 && rt.data.code == 200){
				this.checkLogin = true;
				this.user = rt.data.msg;
				return;
			}
			this.checkLogin = false;
			this.user = {};
		})
*/		
		/*axios.get("type/finds").then( rt => {
			if(rt.status == 200 && rt.data.code == 200){
				this.types = rt.data.msg;
				console.log(this.types);
				return;
			}
		})*/
		
		axios.get("./cartController/list").then( rt => {
			if(rt.status == 200 && rt.data.code == 200){
				this.carts = rt.data.msg;
				this.num = this.carts.length;
				return;
			}
			this.num = 0;
			this.carts = []
		})
	},
		methods:{
			/*findByType: function(flag){
				if (this.tno == flag){
					return;
				}
				this.tno = flag;
				tno = flag;
				app.findByFirst();
			},
			search: function() {
				if(!this.keywords){
					showmsg("请输入你要探索的关键字...", "yellow");
					return;
				}
				
				axios.post("pd/find", qs.stringify({keywords: this.keywords})).then(rt => {
					if(rt.status == 200 && rt.data.code == 200){
						app.$data.products = rt.data.msg;
						
					}
					app.$data.products = [],
					app.$data.page = 1;
					app.$data.totalPage = 0;
				})*/
			
		}
})